<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns:cc="http://java.sun.com/jsf/composite"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:p="http://primefaces.org/ui"
       xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
        <cc:attribute name="billController" />
        <cc:attribute name="dup" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>

        <div >

            <div >
                <div >


                    <h:outputStylesheet name="printing.css" library="css" />

                    <p:commandButton value="Print" ajax="false" action="#" >
                        <p:printer target="gpBillPreview" ></p:printer>
                    </p:commandButton>

                    <div  >

                        <p:panel   id="gpBillPreview"   >

                            <div >
                                <div>


                                    <div class="fiveinchbill" style="font-size: 130%;">
                                        <div  >



                                            <div style="position: absolute!important;left: 60%!important; font-weight: bold!important;
                                                 top: 0%!important;font-size: 15px!important; text-decoration: underline!important;">
                                                <h:outputLabel value="Agency Receipt"   />                           
                                            </div>

                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 7%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Receipt No"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 23%;
                                                 top: 7%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%!important;
                                                 top: 7%!important;
                                                 font-size: 12px!important;">                                                  
                                                <h:outputLabel value="#{cc.attrs.bill.cancelledBill.insId} **Cancelled"  
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId ne null}"/> 
                                                <h:outputLabel value="#{cc.attrs.bill.insId}" 
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId eq null}"/>  
                                                <h:outputLabel value="  **Duplicate" 
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId eq null and cc.attrs.dup eq true }" />
                                            </div>

                                            <div style="position: absolute;
                                                 left: 71%!important;
                                                 top: 7%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Date"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 80%;
                                                 top: 7%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 82%!important;
                                                 top: 7%!important;
                                                 font-size: 12px!important;" >                  
                                                <h:outputLabel value="#{cc.attrs.bill.cancelledBill.billDate}"
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId ne null}"  >
                                                    <f:convertDateTime pattern="dd/MM/yy"/>
                                                </h:outputLabel>                      
                                                <h:outputLabel value="#{cc.attrs.bill.billDate}"
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId eq null }">
                                                    <f:convertDateTime pattern="dd/MM/yy"/>
                                                </h:outputLabel>
                                            </div>

                                            <div style="position: absolute;
                                                 left: 71%!important;
                                                 top: 11%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Time"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 80%;
                                                 top: 11%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 82%;
                                                 top: 11%;
                                                 font-size:12px!important;" >                                                  
                                                <h:outputLabel value="#{cc.attrs.bill.cancelledBill.billTime}"  
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId ne null}">
                                                    <f:convertDateTime pattern="hh:mm a"/>
                                                </h:outputLabel>                        
                                                <h:outputLabel value="#{cc.attrs.bill.billTime}" 
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId eq null }">
                                                    <f:convertDateTime pattern="hh:mm a"/>
                                                </h:outputLabel>
                                            </div>

                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 30%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Agency"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 30%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 30%;
                                                 font-size:12px!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.fromInstitution.name}"   /> 
                                            </div>

                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 34%!important;
                                                 font-size: 12px!important;
                                                 font-weight: bold!important;">
                                                <h:outputLabel value="Code"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 34%;
                                                 font-size:12px!important;
                                                 font-weight: bold!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 34%;
                                                 font-size:12px!important;
                                                 font-weight: bold!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.fromInstitution.institutionCode}" /> 
                                            </div>

                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 38%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Payment Type"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 38%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 38%;
                                                 font-size:12px!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.cancelledBill.paymentMethod}" 
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId ne null}" />                        
                                                <h:outputLabel value="#{cc.attrs.bill.paymentMethod}" 
                                                               rendered="#{cc.attrs.bill.cancelledBill.insId eq null }"/>
                                            </div>

                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 42%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Bank" rendered="#{cc.attrs.bill.bank ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 42%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":" rendered="#{cc.attrs.bill.bank ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 42%;
                                                 font-size:12px!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.bank.name}" rendered="#{cc.attrs.bill.bank ne null}" />
                                            </div>
                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 46%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Date" rendered="#{cc.attrs.bill.chequeDate ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 46%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":" rendered="#{cc.attrs.bill.chequeDate ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 46%;
                                                 font-size:12px!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.chequeDate}" rendered="#{cc.attrs.bill.chequeDate ne null}" >
                                                    <f:convertDateTime pattern="yyyy MM dd"/>
                                                </h:outputLabel>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 0%!important;
                                                 top: 50%!important;
                                                 font-size: 12px!important;">
                                                <h:outputLabel value="Cheque No" rendered="#{cc.attrs.bill.chequeRefNo ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 25%;
                                                 top: 50%;
                                                 font-size:12px!important;">
                                                <h:outputLabel value=":" rendered="#{cc.attrs.bill.chequeRefNo ne null}"/>
                                            </div>
                                            <div style="position: absolute;
                                                 left: 27%;
                                                 top: 50%;
                                                 font-size:12px!important;" >                    
                                                <h:outputLabel value="#{cc.attrs.bill.chequeRefNo}" rendered="#{cc.attrs.bill.chequeRefNo ne null}" />
                                            </div>

                                            <div style="position: absolute;
                                                 left: 15%;
                                                 top: 50%;
                                                 font-size: 150%!important;">
                                                <table>
                                                    <tr>
                                                        <td style="min-width: 3.5cm;text-align: left;">
                                                            <h:outputLabel value="Total"/>
                                                        </td>
                                                        <td>
                                                            <h:outputLabel value="#{cc.attrs.bill.netTotal}"  style="font-size: 110%; font-weight: bold ; text-align: right;    ">
                                                                <f:convertNumber pattern="#,##0.00" />
                                                            </h:outputLabel>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>

                                            <div style="position: absolute;
                                                 left: 20%!important;
                                                 bottom:  3%!important;
                                                 font-size: 12px!important;
                                                 text-decoration: overline;">
                                                <h:outputLabel  value="Cashier : #{cc.attrs.bill.creater.code}"   />
                                            </div>

                                        </div>

                                    </div>


                                </div>
                            </div>

                        </p:panel>
                    </div>

                </div>
            </div>
        </div>


    </cc:implementation>
</html>